home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 May / PCPlus May 1998=disk A.iso / full / CBUILDER / SAMS / SAMPLES / CHAP01 / MULTIPLY.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-12  |  534 b   |  28 lines

  1. #include <condefs.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <iostream.h>
  5. #include <conio.h>
  6. #pragma hdrstop
  7.  
  8. int multiply(int, int);
  9.  
  10. int main(int argc, char **argv)
  11. {
  12.     int x, y, result;
  13.     cout << endl << "Enter the first value: ";
  14.   cin >> x;
  15.   cout << "Enter the second value: ";
  16.   cin >> y;
  17.   result = multiply(x, y);
  18.   cout << "The result is: " << result << endl;
  19.   cout << endl << endl << "Press any key to continue...";
  20.   getch();
  21.   return 0;
  22. }
  23.  
  24. int multiply(int x, int y)
  25. {
  26.   return x * y;
  27. }
  28.